package com.company.TestIO;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.PrintWriter;

public class Test1 {
    //文件流IO
    public static void main(String[] args) throws Exception{


    }

    public static void copy2()throws Exception{

    }

    public static void copy1() throws Exception{
        try (FileInputStream inputStream=new FileInputStream("a")){
            try (FileOutputStream outputStream=new FileOutputStream("b")){
                byte[] buff=new byte[4096];
                int size;
                while ((size=inputStream.read(buff))!=-1){
                    outputStream.write(buff,0,size);
                }
            }
        }
    }


}
